import { myApp, $$, mainView, util, store } from '../index.js';
//import { mapGetters, mapMutations } from 'vuex'


function init() {
    var Child = {
        template: '<div>A custom component!</div>'
    }

    var app = new Vue({
        el: '#app',
        store: store,
        data: {
            todos: [
                { text: 'Learn JavaScript11111' },
                { text: 'Learn Vue' },
                { text: 'Build something awesome' }
            ]
        },
        methods: {
            testinit: function() {
                //  console.log(111)
                console.log(this.$store.state.count)
            },
            addcount: function() {


                //console.log(metadata.host)
                this.$store.commit('increment');
            },
            goa() {
                //    console.log(mainView.router.load)
                let options = {
                    url: metadata.host + '/page/aa.html',

                    query: { id: 'zzzdddd' }
                }
                mainView.router.load(options)
            }

        },
        computed: {
            // ...mapState(['dd']),
            count() {
                return this.$store.state.count
            },
            dd() {
                return this.$store.state.dd
            }
        },
        mounted() {
            // this.testinit()
        },
        components: {

        }
    });
}

export { init }